<form action="<?php echo url_for('character/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" >
<?php echo $form->renderHiddenFields(false); ?>
<?php if($form->renderGlobalErrors() != NULL): ?>
<div class="ui-state-error"><?php echo $form->renderGlobalErrors() ?></div>
<?php endif; ?>
<?php foreach($form as $widget): ?>
<?php if($widget->getName() != "_csrf_token"): ?>
<?php echo $widget->renderLabel(); ?>
<div class="in">
    <?php echo $widget->render(); ?>
    <?php if($widget->renderError() != NULL): ?>
    <div class="ui-state-error">
        <?php echo $widget->renderError() ?>
    </div>
    <?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php $form["_csrf_token"]->render(); ?>
<input type="submit" value="Editer" class="btn success"/>
</form>